<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品请购</title>
    {include file="common/link" /}
</head>
<body>
<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">商品名称 :</label></div>
        <div class="weui-cell__bd">
            <span class="weui-input" >{$row.title}</span>
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">商品编号 :</label></div>
        <div class="weui-cell__bd">
            <span class="weui-input" >{$row.number}</span>
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">商品规格 :</label></div>
        <div class="weui-cell__bd">
            <span class="weui-input" >{$row.specs}</span>
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">商品库存 :</label></div>
        <div class="weui-cell__bd">
            <span class="weui-input" >{$stock}</span>
        </div>
    </div>

    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">请购仓库</label></div>
        <div class="weui-cell__bd">
            <select class="weui-input storehouse" >
                {volist name="houses" id="vo"}
                    <option value="{$vo.id}">{$vo.name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">请购数量</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input purchase_num" type="number" pattern="[0-9]*" placeholder="请输入数量">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">需求日期</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input needtime" type="date" value="">
        </div>
    </div>

<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__hd"><label for="" class="weui-label">时间</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="datetime-local" value="" placeholder="">-->
<!--        </div>-->
<!--    </div>-->

    <div class="weui-btn-area">
        <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips">确定</a>
    </div>
</div>
<div class="weui-cells__tips">请购请购请购</div>
</body>

{include file="common/script" /}
<script>
    $('#showTooltips').click(function () {
        var storehouse_id = $('.storehouse').val()
        var num = $('.purchase_num').val()
        var needtime = $('.needtime').val()
        console.log(storehouse_id)
        console.log(num)
        console.log(needtime)
        var url = ''+location.search
        $.post(url,{storehouse_id:storehouse_id,num:num,needtime:needtime},function (res) {
            layer.msg(res.msg)
            if(res.code >0){
                setTimeout(function () {
                    window.parent.location.reload(); //刷新父页面
                    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);  // 关闭layer
                },800);
            }
        })
    })
</script>

</html>